<template>
  <div class="">
    <div class="header">
      <div class="banxin flxe head">
        <h2 class="logo">ToDoooooooList</h2>
        <div>
          <input
            type="text"
            placeholder="添加ToDo"
            v-model="val"
            class="texts"
            @keyup.enter="add"
          />
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import "../css/index.css";
export default {
  data() {
    return {
      val: "",
    };
  },
  methods: {
    add() {
      this.$store.commit("add", this.val);
      this.val = "";
    },
  },
};
</script>
 
<style lang = "less" scoped>
</style>